package com.cloud.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Component;

import com.cloud.core.BaseDao;
import com.cloud.dao.CrcBean;

/**
 * 1Cloud1
 * @author Administrator
 * @since 2016-1-17
 * @version 1.0 
 */
@Component("CrcDao")
public class CrcDao extends BaseDao {
	
	public List<CrcBean> queryCrcContact(CrcBean bean){
		SqlSession session = super.getInstance(true);
		List<CrcBean> beanList = null;
		try {
			beanList = session.selectList("crc.queryCrcContact", bean);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		} finally {
			session.close();
		}
		return beanList;
	}
	
	public List<CrcBean> getCrcList(CrcBean bean){
		SqlSession session = super.getInstance(true);
		List<CrcBean> beanList = null;
		try {
			beanList = session.selectList("crc.list", bean);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		} finally {
			session.close();
		}
		return beanList;
	}
	
	public void insertCrc(CrcBean bean){
		SqlSession session = super.getInstance(true);
		session.insert("crc.insert", bean);
		session.close();
	}
	
	public void updateCrc(CrcBean bean){
		SqlSession session = super.getInstance(true);
		session.insert("crc.update", bean);
		session.close();
	}
}
